As society develops, increasing quantities of data need to be stored and managed, and is even referred to as massive data. When ultra-large-scale data is managed by means of conventional centralized storage, an efficient read/write operation can hardly be provided, and good expandability and high availability can hardly be met.
Against this backdrop, a storage system consisting of a plurality of physical storage nodes emerges, where each storage node can provide storage space. This storage manner is referred to as distributed storage. There is a distributed storage manner that is referred to as key-value storage. In key-value storage, stored data (or a data fragment) is referred to as a value, and each piece of data has a unique identifier in a scope of the entire storage system, and this identifier is a key. A key and a value are in a one-to-one correspondence.
A key and a value corresponding to the key, as a whole, are referred to as a key-value, K-V for short. Each key-value is stored on a storage disk of the storage system. In a distributed hash table (DHT) technology, for a specific key-value, a storage disk on which the key-value is stored may be determined using a mapping rule. This mapping rule is based on a hash value that is generated by performing a hash operation on a key, where each hash value belongs to one partition, and a partition corresponds to a storage disk, so that each key-value corresponds to one storage disk. Based on this method, if calculated hash values of two different keys are the same, key-values corresponding to the two keys are stored on a same storage disk. A correspondence between a partition and a storage disk is referred to as a partition view.
In the prior art, a Hash value calculated according to a key using the DHT technology falls, for example, within an integer range of [0, 2{circumflex over ( )}32−1]. During system initialization, segmentation is performed on this large integer range, where each segment is equal or approximately equal in size. In this case, one segment is a partition, and quantities of hash values in the partitions are basically the same. When a quantity of storage disks in a storage disk cluster is relatively small, each storage disk has excessive partitions, causing that a partition view is excessively complex, so that data packet forwarding according to the partition view is inefficient. Specific examples are as follows.
It is assumed that there is a cluster that supports a maximum of 25,000 storage disks. In a case of a maximum quantity of storage disks, each storage disk has approximately 100 partitions. That is, the entire cluster has 2,500,000 partitions in total. It is assumed that information in each partition occupies a storage space of four bits. Information in these partitions occupies a storage space of 10 MB in total, and information in a partition view is greater than 10 MB.
When a partition view is used, a large quantity of system resources are occupied.